<template>
    <div class="drawerContainer">
        <el-form :model="propJson" label-width="auto" style="width: 100%">
            <el-form-item label="抽屉绑定参数">
                <el-select v-model="propJson.drawerVisibleParam" placeholder="变量名称" style="width: 100%">
                    <el-option v-for="info in commonParam" :label="info.variableName" :value="info.variableName" />
                </el-select>
            </el-form-item>

            <el-form-item label="抽屉标题">
                <el-input v-model="propJson.title" style="width: 100%"/>
            </el-form-item>

            <el-form-item label="抽屉宽度">
                <el-input v-model="propJson.width" style="width: 100%"/>
            </el-form-item>

            <el-form-item label="是否开启遮罩层">
                <el-radio-group v-model="propJson.isModal">
                    <el-radio :label="true">是</el-radio>
                    <el-radio :label="false">否</el-radio>
                </el-radio-group>
            </el-form-item>

            <el-form-item label="是否开启关闭按钮">
                <el-radio-group v-model="propJson.isShowClose">
                    <el-radio :label="true">是</el-radio>
                    <el-radio :label="false">否</el-radio>
                </el-radio-group>
            </el-form-item>

            <el-form-item label="点击遮罩层关闭">
                <el-radio-group v-model="propJson.isCloseOnClickModal">
                    <el-radio :label="true">是</el-radio>
                    <el-radio :label="false">否</el-radio>
                </el-radio-group>
            </el-form-item>

            <el-form-item label="抽屉打开方向">
                <el-select v-model="propJson.direction" placeholder="抽屉打开方向" style="width: 100%">
                    <el-option label="左侧开启" value="ltr"/>
                    <el-option label="右侧开启" value="rtl"/>
                    <el-option label="顶部开启" value="ttb"/>
                    <el-option label="底部开启" value="btt"/>
                </el-select>
            </el-form-item>

            <el-form-item label="抽屉开启延迟">
                <el-input-number v-model="propJson.openDrawerDelay" :min="0"/>
            </el-form-item>

            <el-form-item label="抽屉关闭延迟">
                <el-input-number v-model="propJson.closeDrawerDelay" :min="0"/>
            </el-form-item>
        </el-form>
    </div>
</template>

<script name="DrawerComponentDrawer" setup lang="ts">
import {computed, defineProps} from "vue";
import {useLowCodeStore} from "@/stores/lowcode/lowcode";

let props = defineProps(['commonParam']);

let commonParam = computed(() => {return props['commonParam']})

let propJson = computed(() => {return useLowCodeStore().lowCodeDrawerJsonInfo});
</script>

<style scoped lang="less">

</style>